#define DEBUG
#include <cstdio>

using namespace std;

bool check(long long n) {
  static int a[19];
  a[0]=0;
  for (int i=1; i<n; i*=10) {
    a[++a[0]] = n/i%10;
  }
  for (int i=1; i<a[0]; i++) {
    if (a[i]==a[i+1]) {
      return false;
    }
    if (i+2<=a[0] && a[i]==a[i+2]) {
      return false;
    }
  }
  return true;
}

int main() {
#ifdef DEBUG
  freopen("0.in", "r", stdin);
  freopen("0_bf.out", "w", stdout);
#endif

  long long a, b, ans=0;
  scanf("%lld %lld", &a, &b);
  for (long long i=a; i<=b; i++) {
    if (check(i)) {
      ans++;
    }
  }
  printf("%lld", ans);

  fclose(stdin);
  fclose(stdout);
  return 0;
}
